home *** CD-ROM | disk | FTP | other *** search
- anzeige.text = this.energy;
- xwalkspeedakt = xwalkspeed + _root.speedausgleich;
- diffx = Math.round(this._x - _root.huntpos._x);
- diffy = Math.round(this._y - _root.huntpos._y);
- if(this.fadeit == true)
- {
- if(this._alpha > 0 && this.fadewaiter > 30)
- {
- this._alpha -= 10;
- }
- else if(this._alpha < 0)
- {
- stop();
- this.removeMovieClip();
- }
- else
- {
- fadewaiter += 1;
- }
- }
- if(this.alive == "true")
- {
- if(_root.playeralive == true)
- {
- if(random(50) < 3)
- {
- this.walkallowed = true;
- }
- else if(random(50) == 4)
- {
- this.walkallowed = false;
- this.enemy.gotoAndStop(1);
- }
- if(this.walkallowed == true)
- {
- this.enemy.play();
- if(diffx > 2)
- {
- this._xscale = 86;
- this._x -= xwalkspeedakt;
- }
- else if(diffx < 0)
- {
- this._xscale = -86;
- this._x += xwalkspeedakt;
- }
- if(diffy > 8)
- {
- this._y -= ywalkspeed;
- }
- else if(diffy < 5)
- {
- this._y += ywalkspeed;
- }
- }
- else
- {
- this._x -= _root.speedausgleich;
- }
- }
- }
- else
- {
- this._x -= _root.speedausgleich;
- }
- this.getroffen = false;
- a = _root.shotactive - 20;
- while(a < _root.shotactive + 1)
- {
- if(_root["shot" + a].hitTest(this.enemy.hitbox) == true)
- {
- _root["shot" + a].removeMovieClip();
- this.getroffen = true;
- }
- a++;
- }
- if(this.alive != "deathsceneplayed")
- {
- if(_root.player.hitbox.hitTest(this.enemy.hitbox) == true)
- {
- if(_root.playeralive == true && this.att_act == false)
- {
- _root.playeralive = false;
- _root.die_init();
- _root.player.gotoAndStop("die");
- this.enemy.gotoAndPlay("att");
- }
- }
- if(this.getroffen == true)
- {
- this.energy -= _root.durchschlag;
- if(this.energy < 0.5)
- {
- var die_ra = random(2) + 1;
- _root.actives -= 1;
- this.alive = "false";
- _root.bodycount += 1;
- _root.score_txt += 100;
- this.enemy.gotoAndPlay("die" + die_ra);
- this.alive = "deathsceneplayed";
- _root.win_level(_root.Level);
- }
- else
- {
- if(xwalkspeed > 2)
- {
- xwalkspeed -= 1;
- }
- _root.score_txt += 50;
- this.enemy.gotoAndPlay("inj");
- if(diffx > 0)
- {
- this._x += 20;
- }
- else if(diffx < 0)
- {
- this._x -= 20;
- }
- }
- }
- }
-